<?php
class Apps_Controller_Plugin_ModuleConfig extends Zend_Controller_Plugin_Abstract {
	public function routeShutdown(Zend_Controller_Request_Abstract $request) {
		$module = $request->getModuleName();
		$front  = Zend_Controller_Front::getInstance();

		switch ($module) {
			case 'admin':
				// Navigation
                Zend_Registry::set('Zend_Navigation',
                    new Zend_Navigation(
                        new Zend_Config_Xml(APPLICATION_PATH. '/modules/admin/configs/navigation.xml', 'navigation')));

                // Layout
                Zend_Layout::getMvcInstance()
                    ->setLayoutPath(APPLICATION_PATH. '/modules/admin/layouts/scripts');

				break;
		}
	}
}